<template>
	<view class="banner">
		<swiper @change="bann" class="banner" indicator-dots="true"  :autoplay="false" :interval="3000" :duration="1000" indicator-color="rgba(255,255,255,.4)"
		indicator-active-color="rgba(255,255,255,.8)">
			<swiper-item v-for="(item,index) in advimg" :key="index">
				<view  class="swiper-item">
					<image style="height: 100vh;width: 100%;" :src="item" mode="heightFix"></image>
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>
<script>
	import {request} from '@/utils/request.js'
	export default {
		data() {
			return {
				banner:[],
				advimg:["../../static/startimg/guide1.jpg","../../static/startimg/guide2.jpg","../../static/startimg/guide3.jpg","../../static/startimg/guide4.jpg","../../static/startimg/guide5.jpg"]
			}
		},
		onLoad() {
		this.getbanner()	
		},
		methods: {
			bann(e){
				console.log(e.detail.current)
				if(e.detail.current==4){
					uni.navigateTo({
						url:"/pages/login/login"
					})
				}
			},
			async getbanner(){
					const res=await request({url:"/prod-api/api/rotation/list?type=2",methods:"get"})
					console.log(res)
					this.banner=res.data.rows
				},
		}
	}
</script>

<style>
	.banner{
		width: 100%;
		height: 100vh;
	}

</style>
